<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="d" uri="http://dgg.net/jsp/jstl/core" %>

<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>生产订单数据</title>
    <c:import url="../../header.jsp"/>
</head>
<body>
<div class="body-main">
    <%--搜索条件--%>
    <div class="titleSearch">
            <d:hasUrlAuth authCode="ZZSC_ZZSJ_JT">
                <div class="layui-inline">
                    <label>生产事业部：</label>
                    <div class="layui-input-inline">
                        <select class="select-style" id="deptId" name="deptId">
                        </select>
                    </div>
                </div>
            </d:hasUrlAuth>
            <label>创建时间：</label>
            <div class="layui-inline">
                <input type="text" name="startTime" placeholder="开始时间" class="Wdate input-style" id="d4311"
                       onFocus="var d4312=$dp.$('d4312'); WdatePicker({onpicked:function(){d4312.focus();}, maxDate:'#F{ $dp.$D(\'d4312\')}', dateFmt:'yyyy-MM-dd'})">
            </div>
            <span>~</span>
            <div class="layui-inline">
                <input type="text" name="endTime" placeholder="结束时间" class="Wdate input-style" id="d4312"
                       onFocus="WdatePicker({minDate:'#F{$dp.$D(\'d4311\')}', dateFmt:'yyyy-MM-dd'})">
            </div>
            <div class="layui-inline">
                <button class="layui-btn layui-btn-mini layui-btn-green" onclick="exportData()">导出</button>
            </div>



    </div>

</div>

<c:import url="/WEB-INF/jsp/footer.jsp"/>
<script src="${basePath}/static/js/zzsc/production/sc_common.js?v=${version}" type="text/javascript"
        charset="utf-8"></script>
<script type="text/javascript"
        src="${basePath}/static/js/zzsc/production/sc_divisionUser.js?v=${version}"></script>
<script type="text/javascript"
        src="${basePath}/static/js/choose.extend.js?v=${version}"></script>
<script type="text/javascript"
        src="${basePath}/static/js/zzsc/inprocess/inprocess_list.js?v=${version}"></script>
<script type="text/javascript">
    var table = null, paras = null;

    $(document).ready(function () {

        <%--//退废单原因--%>
        <%--Plug.plug_in("post", "${basePath}/sc/general/com/tree_book_list.do?code=SC_GENERAL_REASON&type=1&&level=3&status=1", "#abandonReason", '请选择原因', '', true, 'SC_GENERAL_REASON');--%>

        syb("#deptId");//初始化所属事业部
        //业务类型
        Plug.plug_in("post", "${basePath}/zzsc/common/tree_book_list.do?code=BUS_YT_ZZ&&type=2&&level=2", "#business_typeCode", '选择业态', '', true, 'BUS_YT_ZZ', '', '');
        //根据code加载下拉项
        $("select[code]").loadSelectOptions();
        //活动标签,并指定click事件
        $(".title-tab").activeTab({
            fn: function (e) {
                var val = $(e).attr("data");
                var code = $(e).attr("code");
                var $container_status = $("#filter-status");
                var $container_reason = $("#reason-filter");
                var $status = $container_status.find("select").eq(0);
                var $reason = $container_reason.find("select").eq(0);
                if (val == "") {
                    $status.removeAttr("fixed");
                    $container_status.show();
                    $container_reason.hide();
                } else {
                    $status.attr("fixed", true);
                    $container_reason.show();
                    $container_status.hide();
                }
                cleanSearch();
                //设置状态
                $status.val(val);
                //清空原因select option
                $reason.empty();
                $reason.html('<option value="">请选择</option>');
                $reason.attr("code", code);
                $($reason).loadSelectOptions();
                $('#abandonedTable').dataTableExtend("reloadFalse");
            }
        });
    });

    function exportData() {
        var paras = $('.titleSearch').serialize2object();
        /*if (Object.keys(paras).length == 0) {
            DGG.Warning('请加入搜索条件后导出！');
            return;
        }*/
        exportDataAbandoned('/sc/all/export_order_data.do', paras);
    }
</script>
</body>

</html>